<!--
/**************************************************
* @ Affichemanage.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/05/24, owen
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
   
<html>
	<head>
		<title>添加公告信息</title>
		<META http-equiv=Content-Type content="text/html; charset=UTF-8">
        <LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
        <SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
        <SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
			<script language="JavaScript">
			function ByteWordCount(txt) {
				txt = txt.replace(/(<.*?>)/ig,'');
				txt = txt.replace(/([\u0391-\uFFE5])/ig,'11');
				var count = txt.length;
				alert('字符串字数:' + count/2);
			}
			
			String.prototype.length2 = function() {
				var cArr = this.match(/[^x00-xff]/ig);
				return this.length + (cArr == null ? 0 : cArr.length); 
			}
			
		     function check(){ 
		     	if(document.getElementById("gs_affiche_title").value == null || document.getElementById("gs_affiche_title").value == ''){
			      	alert("请录入公告标题");
			      	return false;
			    }
			    var content = document.getElementById("affcont").value;
			    //ByteWordCount(content);
			    if(content.length2() >= 1300){
			    	alert("公告内容超长！");
			    	return false;
			    }
			    

  	            if(confirm('是否确定新增该公告信息？')){
	               //var ary = new Array(4);
                   //ary[0] = Afficheform.gs_affiche_title.value;
                  // ary[1] = Afficheform.gs_affiche_date.value;
                   //ary[2] = Afficheform.gs_affiche_content.value;
                   //ary[3] = Afficheform.filename.value;
                  // alert(ary[3]);
			      // window.returnValue = ary;
			      // window.close();
			      

			      	      
			      Afficheform.action="<%= response.encodeURL(request.getContextPath() + "/A400904.do") %>";   
	              document.Afficheform.submit();
	              //window.returnValue ='1';
	              //window.close();
	            }
	         }
	          
	          function upload(){
	            Afficheform.action = "<%= response.encodeURL(request.getContextPath() + "/A400905.do") %>";
			    Afficheform.submit();
	          }
			</script>
	</head>
	
	<body BGCOLOR="#f2f2f2" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
		<form name="Afficheform" method="post" ENCTYPE="multipart/form-data">
			<input type='hidden' name='requery'>
			<p><br>
			</p>
			<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td width="100%" height="20">
						<table width="100%" border="0" cellspacing="0" cellpadding="1">
							<tr height="20">
								<td height="30" width="758" class="mtxt_black">添加公告信息</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="bg_line" height="2"></td>
				</tr>
			</table>
			<br>
			<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td width="100%">
						<table class="bg_table"  cellspacing="1" cellpadding="0" style="PADDING-RIGHT:
							 5px; PADDING-LEFT: 5px" width="100%" align="center" border="0">
							<TR height="30">
								<TD class="bg_column" align="middle" width="15%">
									公告标题&nbsp;
								</TD>
								<TD align="left" class="bg_row_odd" width="40%">
								   <INPUT type="text" id='gs_affiche_title' name="gs_affiche_title" size="50"> &nbsp; <font color=red>*</font>
								</TD>
								<TD class="bg_column" align="middle" width="10%">发布日期</TD>
								<TD align="left" class="bg_row_odd" width="20%">
								  <INPUT onfocus="setday(this)" readOnly size="20" name="gs_affiche_date" value="<%=DateUtil.getCurrentDate("yyyy-MM-dd")%>">
								</TD>
							</TR>
							
							<tr height=30>
								<TD class="bg_column" align="middle">公告内容</TD>
								<TD class="bg_row_odd"  colspan=3>
								<TEXTAREA id='affcont' name="gs_affiche_content" rows=10 style="WIDTH: 98%"></TEXTAREA>
								</TD>
								
							</tr>
							
							<tr height=30>
								<TD class="bg_column" align="middle">相关文件</TD>
								<TD class="bg_row_odd"  colspan=3>
									<input type="file" name="filename" size="100">
							    </TD>
								
							</tr>
							
						</table>
					</td>
				</tr>
				<tr><td><font color=red><br>(公告内容的长度请限制在1000字之内)</font></td></tr>
			</table>
		</form>
		<p align="center">
		<INPUT type="button" value="保存" class="kuang" onclick="return check();">&nbsp; 
			&nbsp; <INPUT type="button" value="关闭" class="kuang" NAME="Button1" onclick="window.close();">&nbsp;
		</p>
	</body>
</html>
